;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
;;;	Copyright:  2005
;;;	   Edited:  2005
(DEFUN c:hatbnd ( / selhatent hatentdat tenslst1 tenslst2)
  (SETQ selhatent (ENTSEL "\nSelect Hatch for boundary reconstruction. "))
  (IF selhatent
    (SETQ hatentdat (ENTGET (CAR selhatent)))
  )
  (COND
    ((AND hatentdat (EQ (CDR (ASSOC 0 hatentdat)) "HATCH"))
    (PROGN
      (setq tenslst1 (cdr (member (assoc 93 hatentdat) hatentdat)))
      (setq tenslst2 (cdr (member (assoc 97 tenslst1)(reverse tenslst1))))
      (IF tenslst2
        (PROGN
           (ENTMAKE (LIST (CONS 0 "POLYLINE")
                          (CONS 10 (LIST 0 0 0))
                          (CONS 66 1)
                    ) ;_ end of list
           ) ;_ end of entmake
           (FOREACH n tenslst2
             (IF (EQ (CAR n) 10)
               (ENTMAKE (LIST (CONS 0 "VERTEX") n))
             )
           )
           (ENTMAKE (LIST (CONS 0 "VERTEX")(CAR(MEMBER(ASSOC 10 tenslst2)tenslst2))))
           (ENTMAKE (LIST (CONS 0 "SEQEND")))
        )
        (PRINC "\nFailed to find hatch boundary points! ")
      )
    )
     )
    (T (PRINC (STRCAT "\n" (CDR (ASSOC 0 hatentdat)) " was selected, you must select a HATCH object! ")))
  )
  (PRINC)
)